package model.location;

import model.Dimension;

public class ReferencePoint 
{
	
//	private static final float WORLD_DIMENSION = 17;  //Closet
//	private static final float WORLD_DIMENSION = 34;  //Silo Big
	private static final float WORLD_DIMENSION = 140; //Picture Perfect
	
	private String _decodedValue;
	
	private ScreenArea _screenArea;
	private WorldArea _worldArea;
	
	public ReferencePoint(String decodedValue, ScreenArea screenArea)
	{
		_decodedValue = decodedValue;
		_screenArea = screenArea;
		
		getWorldCoordinate();
	}
	
	public String getDecodedValue()
	{
		return _decodedValue;
	}

	public Area getScreenArea()
	{
		return _screenArea;
	}
	
	public Area getWorldArea()
	{
		return _worldArea;
	}
	
	public WorldCoordinate getWorldCoordinate()
	{
		String[] values = _decodedValue.split("_");
		WorldCoordinate centerCoord = new WorldCoordinate(Integer.parseInt(values[0]), Integer.parseInt(values[1]), Integer.parseInt(values[2]));
		_worldArea = new WorldArea(centerCoord, new Dimension(WORLD_DIMENSION, WORLD_DIMENSION), true);
		return (WorldCoordinate) _worldArea.getCenterCoord();
	}
}